#include <QtCore/QCoreApplication>

#include "simcomm.h"
#include <qthread.h>

#include <qdom.h>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    qDebug() << "main thread = " << QThread::currentThread ();

    //QDomDocument doc;
    //QByteArray arryROResult;
    // QString errorStr;
    //int errorLine;
    //int errorColumn;
    //
    //QDomElement root ;
    //root = doc.createElement("root");
    //doc.appendChild(root);
    // QString szData = doc.toString();
    // int ll = szData.size();
    // int l = szData.length();
    // QString str("abc");
    // int lll = str.size();

    SimComm server;
    //int port = 50000;
    int port = 7600;
    qDebug() << "SimComm start listen at " << port;
    if (!server.listen(QHostAddress::Any,port))
    {
        qDebug() << "Unable to start the server: %1."
                << server.errorString();
        getchar();
        return -1;
    }

    return a.exec();
}
